import {requestParam8080} from "@/Network/requestParam8080";
import {requestBody8080} from "@/Network/requestBody8080";
import type {res, typeSong, typeUser} from "@/store/dataType";


// export function testPostRequestParam(data) {
//     let url = "/user-server/user/testRequestParam"
//     return requestForm8082({
//         url: url,
//         method: 'post',
//         data
//     })
// }
//
// export function testPostRequestBody(data) {
//     let url = "/user-server/user/testRequestBody"
//     return requestJson({
//         url: url,
//         method: 'post',
//         data
//     })
// }


export function randomGenerateSongsByNum(num) {
    let url = "/SongController/randomGenerateSongsByNum/"+num
    return requestBody8080({
        url: url,
        method: 'get'
    }) as Promise<res<typeSong[]>>
}

export function findSongById(songId) {
    let url = "/SongController/findById/"+songId
    return requestBody8080({
        url: url,
        method: 'get'
    }) as Promise<res<typeSong>>
}

export function findSongsByStyle(params) {
    let url = "/SongController/findSongsByStyle"
    return requestBody8080({
        url: url,
        method: 'get',
        params
    }) as Promise<res<typeSong[]>>
}
export function findAllBySearchContains(params) {
    let url = "/SongController/findAllBySearchContains"
    return requestBody8080({
        url: url,
        method: 'get',
        params
    }) as Promise<res<typeSong[]>>
}

export function findSongByTitle(data) {
    let url = "/SongController/findSongByTitle"
    return requestBody8080({
        url: url,
        method: 'post',
        data
    }) as Promise<res<typeSong>>
}

export function getTaskList(data) {
    let url = "/task-server/task/list"
    return requestJson8084({
        url: url,
        method: 'post',
        data
    })
}

export function updateTask(data) {
    let url = "/task-server/task/update_task"
    return requestJson8084({
        url: url,
        method: 'post',
        data
    })
}

export function getType(params) {
    let url='/task-server/dictionary/get_value'
    return requestForm8084({
        url: url,
        method: 'get',
        params
    })
}

export function deleteTask(params) {
    let url='/task-server/task/delete_task'
    return requestForm8084({
        url: url,
        method: 'get',
        params
    })
}

export function getTaskById(params) {
    let url='/task-server/task/task_by_code'
    return requestForm8084({
        url: url,
        method: 'get',
        params
    })
}

export function getCode() {
    let url='/task-server/task/get_code'
    return requestForm8084({
        url: url,
        method: 'get',
    })
}
// /task-server/task/check_my_list
export function getCheckTaskList(data) {
    let url = "/task-server/task/check_my_list"
    return requestJson8084({
        url: url,
        method: 'post',
        data
    })
}